<%@ page import="java.util.List" %>
<%@ page import="com.xueqi.bean.EbookCategory" %><%--
  Created by IntelliJ IDEA.
  User: pc
  Date: 2019/10/26
  Time: 21:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script>
        function back() {
            location.href="/entry";
        }
    </script>
</head>
<body>
<h1>增加电子图书</h1>
<form action="/entry" method="post">
    <input type="hidden" name="method" value="add">
<table>
    <tr>
        <td>图书名称：</td>
        <td><input type="text" name="bookname"></td>
    </tr>
    <tr>
        <td>图书类型：</td>
        <td><select name="booktype">
            <%

                List<EbookCategory> categoryList=(List<EbookCategory>) request.getAttribute("types");
                for (EbookCategory category:categoryList) {


            %>
            <option value="<%=category.getId()%>"><%=category.getName()%></option>
            <%}%>
        </select></td>
    </tr>
    <tr>
        <td>图书摘要：</td>
        <td><textarea rows="5" cols="20" name="content"></textarea></td>
    </tr>
    <tr>
        <td>上传人：</td>
        <td><input type="text" name="username"></td>
    </tr>
    <tr>
        <td>上传时间：</td>
        <td><input type="text" name="time"></td>
    </tr>
    <tr>
        <td><input type="submit" name="submit"></td>
        <td><input type="button"  value="返回" onclick="back()"></td>
    </tr>
</table>
</form>
</body>
</html>
